package com.dyz.swordFingerOffer;

/**
 * @author: daiyizheng
 * @date: 2021/6/10 23:06
 * @description:
 */
public class LeftRotateString58 {
    public static void main(String[] args) {
        new LeftRotateString58().LeftRotateString("abcdefg", 2);
    }
    public String LeftRotateString(String str,int n) {
        if(str.length()==0){
            return "";
        }
        StringBuilder sb = new StringBuilder(str).reverse();
        String str1 = sb.substring(0,sb.length()-n);
        String str2 = sb.substring(sb.length()-n,sb.length());
        return new StringBuilder(str1).reverse().append(new StringBuilder(str2).reverse()).toString();

    }
}
